package com.hisense.ovcloud.common3.base;

//@Component
//@Order(-2)
public class GlobalErrorWebExceptionHandler {
//        extends AbstractErrorWebExceptionHandler {
//    public GlobalErrorWebExceptionHandler(ErrorAttributes errorAttributes, WebProperties.Resources resources, ApplicationContext applicationContext) {
//        super(errorAttributes, resources, applicationContext);
//        ServerCodecConfigurer serverCodecConfigurer = new DefaultServerCodecConfigurer();
//        super.setMessageWriters(serverCodecConfigurer.getWriters());
//    }
//    // 构造函数
//    @Override
//    protected RouterFunction<ServerResponse> getRoutingFunction(final ErrorAttributes errorAttributes) {
//        return RouterFunctions.route(RequestPredicates.all(), this::renderErrorResponse);
//    }
//
////    private Mono<ServerResponse> renderErrorResponse(final ServerRequest request) {
////        final Map<String, Object> errorPropertiesMap = getErrorAttributes(request, true);
////        return ServerResponse.status(HttpStatus.OK).
////                contentType(MediaType.APPLICATION_JSON).body(BodyInserters.fromObject(errorPropertiesMap));
////    }
}
